package bamboo.design_pattern.chap20_iter.book;

import java.util.ArrayList;

/**
 * @Author: fulw
 * @Date: 2021/12/21 11:12
 */
public class Project implements IProject {
    private ArrayList<IProject> projectList = new ArrayList<IProject>();
    String name = "";
    String money = "";
    String countPeople = "";

    public Project() {
    }

    public Project(String name, String money, String countPeople) {
        this.countPeople = countPeople;
        this.name = name;
        this.money = money;
    }

    public void add(String name, String money, String countPeople) {
        this.projectList.add(new Project(name, money, countPeople));
    }

    public String showProjectInfo() {
        String info = "项目信息是：";
        info = info + "name:" + name + ";";
        info = info + "money:" + money + ";";
        info = info + "countPeople:" + countPeople + ";";
        return info;
    }

    public ProjectIterator iterator(){
        return new ProjectIterator(this.projectList);
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public void setCountPeople(String countPeople) {
        this.countPeople = countPeople;
    }
}
